package com.wynne.ptldemo.service.serviceimpl.modules;


import com.wynne.ptldemo.bo.TagSignalBo;
import com.wynne.ptldemo.consts.ResultBean;
import com.wynne.ptldemo.enums.TagType;
import com.wynne.ptldemo.service.IModuleService;
import com.wynne.ptldemo.ws.StationWebSocket;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class FinalizerValidationModule implements IModuleService {

    @Autowired
    private StationWebSocket webSocket;

    @Override
    public ResultBean execModule(TagSignalBo signalBo) {
        System.out.println("FinalizerValidationModule");
        webSocket.sendMessage("1", "完成器校验");

        if (signalBo.getTagType() == TagType.BIN_TAG.getValue()) {
            return ResultBean.createByError();
        } else {
            return ResultBean.createBySuccess();
        }
    }
}
